
public class SavingsAccount extends Account {
	/**
	 * interest rate of the savings account
	 */
	private static double interestRate = 1.25;
	/**
	 * Creates a savings account.
	 * @param name the savings account owner's name
	 * @param street the savings account owner's street
	 * @param zipCode the savings account owner's town zip code
	 * @param town the savings account owner's town
	 * @param country the savings account owner's country
	 * @param savingsAccountNumber the savings account number tied to this account
	 */
	public SavingsAccount(String name, String street, String zipCode, String town, String country, int savingsAccountNumber)
	{
		fName = name;
		fStreet = street;
		fZipcode = zipCode;
		fTown = town;
		fCountry = country;
		fAccountNumber = savingsAccountNumber;
	}
	/**
	 * getter for accountNumber
	 * @return accountNumber
	 */
	public int getAccountNumber() 
	{
		return fAccountNumber;	
	}
	/**
	 * calculates interest for the savings account
	 */
	public void calculateInterest()
	{
		fBalance = fBalance + (fBalance * interestRate / 100);
	}
	/**
	 * used to withdrawal money as long as balance does not go below zero
	 * @param amount the amount withdrawing
	 * @return true if withdrawal went through false otherwise
	 */
	public boolean withdrawal(double amount)
	{
		if(((fBalance - amount) < 0))
		{
			return false;
		}
		else
		{
			fBalance = fBalance - amount;
			return true;
		}
	}
	/**
	 * used to deposit money into savings account.
	 * @param amount the amount deposited.
	 */
	public void deposit(double amount)
	{
		fBalance = fBalance + amount;
	}
	/**
	 * print statement that prints out information
	 * pertaining to account
	 */
	public void print()
	{
		System.out.println("**************************************");
		System.out.println("Savings account:     " + fAccountNumber);
		System.out.println("Account holder name: " + fName);
		System.out.println("Address:             " + fStreet);
		System.out.print("                     " + fZipcode);
		System.out.println(" " + fTown);
		System.out.println(fCountry.toUpperCase());
		System.out.println("**************************************");
		System.out.println("Balance:  " + fBalance);
		System.out.println("**************************************");
	}



	
	
}
